Report post

Is a constant a static property or a module-local const?

Every constant is a @const static property or a module-local const declaration, but not all @const static properties and module-local consts are constants. Before choosing constant case, consider whether the field really feels like a deeply immutable constant.

What is the correct case for consts in C#?

@usefulBee "SNAKE_CASE" is strongly discouraged in C#; This answer is wrong. The correct case for consts in C# is "TitleCase". @usefulBee Agree. But it's still good to mark what is the consensus way of writing it though.

Which case should I use for cons3 & cons4?

public static readonly int cOns3 = 3; public static readonly int CONS4 = 4; I, too, prefer this as Pascal casing can easily be confused with a property reference. Regardless of the recommendations above, I prefer the UPPER_CASE for constants as well, as it makes them much easier to identify compared to any of the other cases.

The World's Leading Crypto Trading Platform

Get my welcome gifts